﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AgilePlannerDT.Data.Impl
{
    public class TeamMemberDataObject:TeamMember
    {
        string name;
        #region constructor
        public TeamMemberDataObject() : this("") { }

        public TeamMemberDataObject(string name)
        {
            this.name = name;
        }
        #endregion

        #region TeamMember Members

        public string Name
        {
            get
            {
                return this.name;
            }
            set
            {
                this.name = value;
            }
        }

        public override bool Equals(object owner)
        {
            if (owner is TeamMemberDataObject)
                return (Name.Equals(((TeamMemberDataObject)owner).Name));
            return false;
        }

        public override int GetHashCode()
        {
            const int prime = 31;
            int result = 1;
            result = prime * result + ((Name == null) ? 0 : Name.GetHashCode());
            return result;
        }

       

        #endregion

        #region ICloneable Members


        #endregion

        #region IXmlSerializable Members

        public System.Xml.Schema.XmlSchema GetSchema()
        {
            throw new NotImplementedException();
        }

        public void ReadXml(System.Xml.XmlReader reader)
        {
            throw new NotImplementedException();
        }

        public void WriteXml(System.Xml.XmlWriter writer)
        {
            writer.WriteStartElement("USERS");
            writer.WriteAttributeString("Name", Name);
            writer.WriteEndElement();
        }

        #endregion

        #region TeamMember Members

        string TeamMember.Name
        {
            get
            {
                return  this.name;
            }
            set
            {
                this.name = value;
            }
        }

        bool TeamMember.Equals(object owner)
        {
            throw new NotImplementedException();
        }

        #endregion

        #region ICloneable Members

        object ICloneable.Clone()
        {
            return new TeamMemberDataObject(Name);
        }

        #endregion




  
    }
}
